package com.example.zhinongbao.bean;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Property;

@Entity
public class Article {
    /**
     * 文章标题
     */
    @Property(nameInDb = "TITLE")
    @Id
    private String title;
    /**
     * 文章内容
     */
    @Property(nameInDb = "CONTENT")
    private String content;
    /**
     * 文章类型
     */
    @Property(nameInDb = "TYPE")
    private int type;
    /**
     * 图像uri
     */
    @Property(nameInDb = "IMAGE_URI")
    private String imageUri;
    /**
     * 发布时间
     */
    @Property(nameInDb = "TIME")
    private String time;
    /**
     * 浏览量
     */
    @Property(nameInDb = "VIEWS")
    private int views;

    @Generated(hash = 1343271043)
    public Article(String title, String content, int type, String imageUri, String time, int views) {
        this.title = title;
        this.content = content;
        this.type = type;
        this.imageUri = imageUri;
        this.time = time;
        this.views = views;
    }

    @Generated(hash = 742516792)
    public Article() {
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getImageUri() {
        return imageUri;
    }

    public void setImageUri(String imageUri) {
        this.imageUri = imageUri;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public int getViews() {
        return views;
    }

    public void setViews(int views) {
        this.views = views;
    }

    @Override
    public String toString() {
        return "Article{" +
                "title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", type='" + type + '\'' +
                ", imageUri='" + imageUri + '\'' +
                ", time='" + time + '\'' +
                ", views=" + views +
                '}';
    }
}
